import argparse
import json
import math
import os, cv2

import numpy as np
from tqdm import tqdm


parser = argparse.ArgumentParser('rec')
parser.add_argument("--basepath", type=str, default='/home/train_data/hphm')
parser.add_argument("--txtpath", type=str, default='/home/train_data/hphm/train_hphm_det_total.txt')
parser.add_argument("--txtsavepath", type=str, default='/home/train_data/hphm/train_hphm_det_all.txt')
args = parser.parse_args()

fi = open(args.txtpath,"r",encoding='utf-8').readlines()
f = open(args.txtsavepath,"w",encoding='utf-8')

for i in fi:
    re_path, _=i.strip().split("\t")
    # print(re_path)

    if os.path.exists(os.path.join(args.basepath,re_path)):
        print(i)
        f.write(i)

